import axios from "axios"


export function request(config){
    //创建axios实例
    const instance=axios.create({
        baseURL:'http://123.207.32.32:8000/api/h8',
        timeout:5000
    })

    //axios拦截
    //请求拦截
    instance.interceptors.request.use(config=>{
        //console.log(config)
        //处理数据

        return config
    },error => {

    })

    //拦截结果
    instance.interceptors.response.use(res=>{
      //  console.log(res)
        return res.data
    },error => {})

    //发送真正的网咯请求
    return instance(config)
}